package com.yxk;

import com.yxk.api.ProductApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@EnableFeignClients
@EnableDiscoveryClient
@SpringBootApplication
public class UserServer3App {
    public static void main(String[] args) {
        SpringApplication.run(UserServer3App.class, args);
    }

    @RestController
    class DcController {

        @Autowired
        private ProductApi productApi;

        @GetMapping("/consumer")
        public String dc() {
            return "user-server3" + productApi.hello();
        }
    }
}
